package com.ixuea.courses.starthelperforninestudy;

import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.widget.Toast;
import com.google.android.exoplayer2.C;
import tv.danmaku.ijk.media.player.IjkMediaMeta;
import tv.danmaku.ijk.media.player.IjkMediaPlayer;

/* loaded from: classes.dex */
public class CaiZhiHelper {
    private static final CaiZhiHelper helper = new CaiZhiHelper();

    public static CaiZhiHelper getInstance() {
        return helper;
    }

    public void startChinese(Context context, String str) {
        try {
            Intent intent = new Intent("android.intent.action.VIEW");
            intent.putExtra(IjkMediaMeta.IJKM_KEY_TYPE, 1);
            intent.putExtra("linkId", str);
            intent.putExtra("isForm_ninestudy", true);
            intent.setComponent(new ComponentName("com.caizhi.cloud", "com.caizhi.cloud.ui.activity.language.LanguageActivity"));
            intent.setFlags(C.ENCODING_PCM_MU_LAW);
            context.startActivity(intent);
        } catch (Exception e) {
            e.printStackTrace();
            Toast.makeText(context, "启动失败,请检查机器是否装有此应用", 0).show();
        }
    }

    public void startMemoryMaster(Context context, String str) {
        try {
            Intent intent = new Intent("android.intent.action.VIEW");
            intent.putExtra(IjkMediaMeta.IJKM_KEY_TYPE, 6);
            intent.putExtra("linkId", str);
            intent.putExtra("isForm_ninestudy", true);
            intent.setComponent(new ComponentName("com.caizhi.cloud", "com.caizhi.cloud.ui.activity.language.NewMemoryMasterActivity"));
            intent.setFlags(C.ENCODING_PCM_MU_LAW);
            context.startActivity(intent);
        } catch (Exception e) {
            e.printStackTrace();
            Toast.makeText(context, "启动失败,请检查机器是否装有此应用", 0).show();
        }
    }

    public void startEnglish(Context context, String str) {
        try {
            Intent intent = new Intent("android.intent.action.VIEW");
            intent.putExtra(IjkMediaMeta.IJKM_KEY_TYPE, 2);
            intent.putExtra("linkId", str);
            intent.putExtra("isForm_ninestudy", true);
            intent.setComponent(new ComponentName("com.caizhi.cloud", "com.caizhi.cloud.ui.activity.HomeActivity"));
            intent.setFlags(C.ENCODING_PCM_MU_LAW);
            context.startActivity(intent);
        } catch (Exception e) {
            e.printStackTrace();
            Toast.makeText(context, "启动失败,请检查机器是否装有此应用", 0).show();
        }
    }

    public void startZongheJiYi(Context context, String str) {
        try {
            Intent intent = new Intent("android.intent.action.VIEW");
            intent.putExtra(IjkMediaMeta.IJKM_KEY_TYPE, 3);
            intent.putExtra("linkId", str);
            intent.putExtra("isForm_ninestudy", true);
            intent.setComponent(new ComponentName("com.caizhi.cloud", "com.caizhi.cloud.ui.activity.language.ZongHeJiyiActivity"));
            intent.setFlags(C.ENCODING_PCM_MU_LAW);
            context.startActivity(intent);
        } catch (Exception e) {
            e.printStackTrace();
            Toast.makeText(context, "启动失败,请检查机器是否装有此应用", 0).show();
        }
    }

    public void startMemoryClass(Context context, String str) {
        try {
            Intent intent = new Intent("android.intent.action.VIEW");
            intent.putExtra(IjkMediaMeta.IJKM_KEY_TYPE, 4);
            intent.putExtra("linkId", str);
            intent.putExtra("isForm_ninestudy", true);
            Bundle bundle = new Bundle();
            bundle.putInt("fragmentType", 4);
            intent.putExtras(bundle);
            intent.setComponent(new ComponentName("com.caizhi.cloud", "com.caizhi.cloud.ui.activity.LandscapeCommonActivity"));
            intent.setFlags(C.ENCODING_PCM_MU_LAW);
            context.startActivity(intent);
        } catch (Exception e) {
            e.printStackTrace();
            Toast.makeText(context, "启动失败,请检查机器是否装有此应用", 0).show();
        }
    }

    public void startFastRead(Context context, String str) {
        try {
            Intent intent = new Intent("android.intent.action.VIEW");
            intent.putExtra(IjkMediaMeta.IJKM_KEY_TYPE, 5);
            intent.putExtra("linkId", str);
            intent.putExtra("isForm_ninestudy", true);
            intent.putExtra(IjkMediaPlayer.OnNativeInvokeListener.ARG_URL, "https://nuxt-cloud.yixuewang.cn/efficientReading?");
            intent.putExtra("Can_CACHE", false);
            intent.setComponent(new ComponentName("com.caizhi.cloud", "com.caizhi.cloud.ui.activity.WebViewForJiYiActivity"));
            intent.setFlags(C.ENCODING_PCM_MU_LAW);
            context.startActivity(intent);
        } catch (Exception e) {
            e.printStackTrace();
            Toast.makeText(context, "启动失败,请检查机器是否装有此应用", 0).show();
        }
    }
}
